/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mb.config;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import mb.mbpart.async.AysncObject;

/**
 *
 * @author thanh.nguyenchi
 */
public class DatabaseConfig {
    private String url;
    private String user;
    private String pass;
    private int preferred_id;
    private int promotion_id;
    private int services_id;
    private int subCompany_id;
    private int pageLimit;
    private List<Long> servicesList;
    
    private BlockingQueue<AysncObject> updateQueue;
    
    public DatabaseConfig(){
        servicesList = new ArrayList<Long>();
    }
    
    public void addService(long id){
        servicesList.add(id);
    }
    
    public boolean checkService(long id){
        for (long x : servicesList) {
            if (x == id) {
                return true;
            }
        }
        return false;
    }

    /**
     * @return the url
     */
    public String getUrl() {
        return url;
    }

    /**
     * @param url the url to set
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * @return the user
     */
    public String getUser() {
        return user;
    }

    /**
     * @param user the user to set
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * @return the pass
     */
    public String getPass() {
        return pass;
    }

    /**
     * @param pass the pass to set
     */
    public void setPass(String pass) {
        this.pass = pass;
    }

    /**
     * @return the preferred_id
     */
    public int getPreferred_id() {
        return preferred_id;
    }

    /**
     * @param preferred_id the preferred_id to set
     */
    public void setPreferred_id(int preferred_id) {
        this.preferred_id = preferred_id;
    }
    
    public String getPreferred_string(){
        return String.valueOf(preferred_id);
    }

    /**
     * @return the promotion_id
     */
    public int getPromotion_id() {
        return promotion_id;
    }
    
    public String getPromotion_string(){
        return String.valueOf(promotion_id);
    }

    /**
     * @param promotion_id the promotion_id to set
     */
    public void setPromotion_id(int promotion_id) {
        this.promotion_id = promotion_id;
    }

    /**
     * @return the services_id
     */
    public int getServices_id() {
        return services_id;
    }

    /**
     * @param services_id the services_id to set
     */
    public void setServices_id(int services_id) {
        this.services_id = services_id;
    }

    /**
     * @return the updateQueue
     */
    public BlockingQueue<AysncObject> getUpdateQueue() {
        return updateQueue;
    }

    /**
     * @param updateQueue the updateQueue to set
     */
    public void setUpdateQueue(BlockingQueue<AysncObject> updateQueue) {
        this.updateQueue = updateQueue;
    }

    /**
     * @return the subCompany_id
     */
    public int getSubCompany_id() {
        return subCompany_id;
    }

    /**
     * @param subCompany_id the subCompany_id to set
     */
    public void setSubCompany_id(int subCompany_id) {
        this.subCompany_id = subCompany_id;
    }

    /**
     * @return the pageLimit
     */
    public int getPageLimit() {
        return pageLimit;
    }

    /**
     * @param pageLimit the pageLimit to set
     */
    public void setPageLimit(int pageLimit) {
        this.pageLimit = pageLimit;
    }
    
    
}
